[IA64] fix RSE issues rlated to handle_lazy_cover().
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 23 Jun 2006 21:24:06 +0000 (15:24 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 23 Jun 2006 21:24:06 +0000 (15:24 -0600)
commit88fae8bdd70bfa0983b02fb3272c947df0bdc621
tree4e8600fb07d1b593cdb314079e8c2a89aa0d257c
parent9822dce3f2ba9d0b98be8de7fd982f3cb205859f
[IA64] fix RSE issues rlated to handle_lazy_cover().

It must be after trying vTLB in ia64_do_page_fault().

This patch fixes the following scenario.

linux-2.6-xen-sparse/arch/ia64/xen/xenentry.S
Here psr.i and psr.ic is off
rse_clear_invalid:
...
(pRecurse) br.call.dptk.few b0=rse_clear_invalid
        ;;
        mov loc8=0
        mov loc9=0

1. Right before mov loc8=0, vcpu is switched to another cpu.
2. While the vcpu is waiting for cpu, the tlb entry which backs the rse
   stack is purged.
3. The vcpu gets cpu again, tlb miss fault occurs with isr.ir = 1.
4. xen ia64_do_page_fault() calls handle_lazy_cover() which sets
   cr.ifs = 0.
5. xen returns cpu execution to the guest.
6. mov loc8 = 0 is executed with cfm = 0.
   Illigal operation fault is raised
7. priv_handle_op() is called. but it fails to emulate because
   mov loc8 = 0 isn't privileged op.
8. ia64_handle_privop() calls panic_domain().

Signed-off-by: Xu, Anthony <anthony.xu@intel.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/faults.c